package com.ashapo;
//import com.mysql.jdbc.Driver;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author Administrator
 */
public class MMySQL {
	
	private static final String URL = "jdbc:mysql://localhost:3306/gm_test";
	
	private static final String USER = "root";
	
	private static final String PASSWORD = "123456";

	/**
	 * @param args the command line arguments
	 * @throws ClassNotFoundException
	 * @throws SQLException
	 */
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		Class.forName("com.mysql.jdbc.Driver");
		Connection conn = DriverManager.getConnection(URL, USER, PASSWORD);
		Statement stmt = conn.createStatement();
		ResultSet rs = stmt.executeQuery("SELECT * FROM `user`");
		while (rs.next()) {			
			System.out.println(rs.getString("id") + rs.getString("name"));
			System.out.println(rs.getBigDecimal("add_time"));
		}
	}
	
}
